<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="urn:hl7-org:v3 ..\sdschemas\SDA.xsd">
    <#assign templateData={"title":"转诊（院）记录", "code":"HSDC00.05", "templateId":"2.16.156.10011.2.1.1.20"}>
    <#include "fragment/header/headerEles.ftl">
    <recordTarget typeCode="RCT" contextControlCode="OP">
        <patientRole classCode="PAT">
            <id root="2.16.156.10011.1.2" extension="${docData.patientRole.id}"/>  <!--1-->
            <id root="2.16.156.10011.1.13" extension="${docData.patientRole.zhuYuanHBS}"/>
            <addr use="H">
                <#if docData.patientRole.addr.houseNumber??>
                    <houseNumber>${docData.patientRole.addr.houseNumber}</houseNumber>
                </#if>
                <#if docData.patientRole.addr.streetName??>
                    <streetName>${docData.patientRole.addr.streetName}</streetName>
                </#if>
                <#if docData.patientRole.addr.township??>
                    <township>${docData.patientRole.addr.township}</township>
                </#if>
                <#if docData.patientRole.addr.county??>
                    <county>${docData.patientRole.addr.county}</county>
                </#if>
                <#if docData.patientRole.addr.city??>
                    <city>${docData.patientRole.addr.city}</city>
                </#if>
                <#if docData.patientRole.addr.state??>
                    <state>${docData.patientRole.addr.state}</state>
                </#if>
                <#if docData.patientRole.addr.postalCode??>
                    <postalCode>${docData.patientRole.addr.postalCode}</postalCode>
                </#if>
            </addr>
            <#--            <telecom value="18624135876"/>-->
            <patient classCode="PSN" determinerCode="INSTANCE">
                <#if docData.patientRole.patient.id??>
                    <id root="2.16.156.10011.1.3" extension="${docData.patientRole.patient.id}"/>
                </#if>
                <name>${docData.patientRole.patient.name}</name>
                <#if docData.patientRole.patient.administrativeGender??>
                    <administrativeGenderCode code="${docData.patientRole.patient.administrativeGender.code}"
                                              codeSystem="2.16.156.10011.2.3.3.4"
                                              displayName="${docData.patientRole.patient.administrativeGender.displayName}"
                                              codeSystemName="生理性别代码表(GB/T 2261.1)"/>
                </#if>
                <#if docData.patientRole.patient.birthTime??>
                    <birthTime value="${docData.patientRole.patient.birthTime}"/>
                </#if>
                <#if docData.patientRole.patient.maritalStatus??>
                    <maritalStatusCode code="${docData.patientRole.patient.maritalStatus.code}"
                                       codeSystem="2.16.156.10011.2.3.3.5"
                                       displayName="${docData.patientRole.patient.maritalStatus.displayName}"
                                       codeSystemName="婚姻状况代码表(GB/T 2261.2)"/>
                </#if>
                <#--                <ethnicGroupCode code="01" codeSystem="2.16.156.10011.2.3.3.3" displayName="汉族"-->
                <#--                                 codeSystemName="民族类别代码表(GB 3304)"/>-->
                <#if docData.patientRole.patient.employerOrganization??>
                    <employerOrganization>
                        <name>${docData.patientRole.patient.employerOrganization}</name>
                        <telecom value="${docData.patientRole.patient.telecom}"/>  <!--1-->
                    </employerOrganization>
                </#if>
                <#if docData.patientRole.patient.householdAddr??>
                    <household>
                        <place>
                            <addr>
                                <#if docData.patientRole.patient.householdAddr.houseNumber??>
                                    <houseNumber>${docData.patientRole.patient.householdAddr.houseNumber}</houseNumber>
                                </#if>
                                <#if docData.patientRole.patient.householdAddr.houseNumber??>
                                    <streetName>${docData.patientRole.patient.householdAddr.streetName}</streetName>
                                </#if>
                                <#if docData.patientRole.patient.householdAddr.houseNumber??>
                                    <township>${docData.patientRole.patient.householdAddr.township}</township>
                                </#if>
                                <#if docData.patientRole.patient.householdAddr.houseNumber??>
                                    <county>${docData.patientRole.patient.householdAddr.county}</county>
                                </#if>
                                <#if docData.patientRole.patient.householdAddr.houseNumber??>
                                    <city>${docData.patientRole.patient.householdAddr.city}</city>
                                </#if>
                                <#if docData.patientRole.patient.householdAddr.houseNumber??>
                                    <state>${docData.patientRole.patient.householdAddr.state}</state>
                                </#if>
                            </addr>
                        </place>
                    </household>
                </#if>
                <#if docData.patientRole.patient.educationLevel??>
                    <educationLevel>
                        <educationLevelCode code="${docData.patientRole.patient.educationLevel.code}"
                                            codeSystem="2.16.156.10011.2.3.3.6"
                                            displayName="${docData.patientRole.patient.educationLevel.displayName}"
                                            codeSystemName="学历代码表(GB/T 4658)"/>
                    </educationLevel>
                </#if>
                <#if docData.patientRole.patient.occupation??>
                    <occupation>
                        <occupationCode code="${docData.patientRole.patient.occupation.code}"
                                        codeSystem="2.16.156.10011.2.3.3.7"
                                        displayName="${docData.patientRole.patient.occupation.displayName}"
                                        codeSystemName="职业类别代码表(GB/T 6565)"
                                        codeSystemVersion="职业类别代码表（GB/T 6565）"/>
                    </occupation>
                </#if>
            </patient>
        </patientRole>
    </recordTarget>
    <author typeCode="AUT" contextControlCode="OP">
        <time value="${docData.author.time}" xsi:type="TS"/>
        <assignedAuthor classCode="ASSIGNED">
            <id root="2.16.156.10011.1.7" extension="${docData.author.id}"/>
            <assignedPerson>
                <name>${docData.author.name}</name>
            </assignedPerson>
            <representedOrganization>
                <id root="2.16.156.10011.1.5" extension="${docData.author.organizationId}"/>
                <name>${docData.author.organizationName}</name>
                <addr/>
            </representedOrganization>
        </assignedAuthor>
    </author>
    <custodian typeCode="CST">
        <assignedCustodian classCode="ASSIGNED">
            <representedCustodianOrganization classCode="ORG" determinerCode="INSTANCE">
                <id root="2.16.156.10011.1.6" extension="${docData.custodian.id}"/>
                <name>${docData.custodian.name}</name>
                <#if docData.custodian.telecom??>
                    <telecom value="${docData.custodian.telecom}"/>
                </#if>
                <#if docData.custodian.addr??>
                    <addr>${docData.custodian.addr}</addr>
                <#else>
                    <addr/>
                </#if>
            </representedCustodianOrganization>
        </assignedCustodian>
    </custodian>
    <legalAuthenticator>
        <time value="${docData.legalAuthenticator.time}"/>
        <signatureCode/>
        <assignedEntity>
            <id/>
            <assignedPerson>
                <name>${docData.legalAuthenticator.name}</name>
            </assignedPerson>
        </assignedEntity>
    </legalAuthenticator>
    <participant typeCode="ATND">
            <associatedEntity classCode="ECON">
                <code/>
                <telecom value="${docData.participant.telecom}"/>
                <associatedPerson classCode="PSN" determinerCode="INSTANCE">
                    <name>${docData.participant.name}</name>
                </associatedPerson>
                <scopingOrganization>
                    <asOrganizationPartOf>
                        <wholeOrganization>
                            <id root="2.16.156.10011.1.5" extension="${docData.participant.zhuanZhenJGDM!'-'}"/>
                            <name>${docData.participant.zhuanZhenJGMC!'-'}</name>
                        </wholeOrganization>
                    </asOrganizationPartOf>
                </scopingOrganization>
            </associatedEntity>
    </participant>
    <relatedDocument typeCode="APND">
        <parentDocument moodCode="EVN" classCode="DOCCLIN">
            <id root="2.16.156.10011.1.1.2" extension="D2011000000"/>
            <setId/>
            <versionNumber value="1"/>
        </parentDocument>
    </relatedDocument>

    <component>
        <structuredBody>
            <#if docData.zhenDuan??>
            <component>
                <section>
                    <code code="29548-5" codeSystem="2.16.840.1.113883.6.1" displayName="Diagnosis"
                          codeSystemName="LOINC"/>
                    <text/>
                    <entry>
                        <organizer moodCode="EVN" classCode="CLUSTER">
                            <statusCode/>
                            <component>
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE05.01.025.00" codeSystem="2.16.156.10011.2.2.1" displayName="诊断结果"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="ST">${docData.zhenDuan.zhenDuanMC}</value>
                                </observation>
                            </component>
                            <component>
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE05.01.024.00" codeSystem="2.16.156.10011.2.2.1" displayName="诊断代码"
                                          codeSystemName="卫生信息数据元目录"/>
                                    <value code="${docData.zhenDuan.zhenDuanDM}" xsi:type="CD"
                                           codeSystem="2.16.156.10011.2.3.3.11"
                                           displayName="${docData.zhenDuan.zhenDuanMC}"
                                           codeSystemName="ICD-10"/>
                                </observation>
                            </component>
                        </organizer>
                    </entry>
                </section>
            </component>
            </#if>
            <component>
                <section>
                    <code code="30954-2" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="STUDIES SUMMARY"/>
                    <text/>
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE04.30.015.05" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录" displayName="检查（检验）类别"/>
                            <value xsi:type="ST">检查（检验）类别</value>
                        </observation>
                    </entry>
                    <entry>
                        <organizer classCode="CLUSTER" moodCode="EVN">
                            <statusCode/>
                            <component>
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE04.30.015.04" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录" displayName="检查（检验）项目名称"/>
                                    <value xsi:type="ST">经直肠妇科彩超常规检查</value>
                                </observation>
                            </component>
                            <component>
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE04.30.015.03" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录" displayName="检查（检验）项目代码"/>
                                    <value xsi:type="ST">经直肠妇科彩超常规检查</value>
                                </observation>
                            </component>
                            <component>
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE04.30.015.06" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录" displayName="检查（检验）结果代码"/>
                                    <value xsi:type="CD" code="1" displayName="异常" codeSystem="2.16.156.10011.2.3.2.38" codeSystemName="检查/检验结果代码表"/>
                                </observation>
                            </component>
                            <component>
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE04.30.015.01" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录" displayName="检查(检验)定量结果"/>
                                    <value xsi:type="INT" value="3"/>
                                    <entryRelationship typeCode="COMP">
                                        <observation classCode="OBS" moodCode="EVN">
                                            <code code="DE04.30.015.02" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录" displayName="检查(检验)计量单位"/>
                                            <value xsi:type="ST">张</value>
                                        </observation>
                                    </entryRelationship>
                                </observation>
                            </component>
                        </organizer>
                    </entry>
                </section>
            </component>
            <component>
                <section>
                    <code code="10160-0" codeSystem="2.16.840.1.113883.6.1" displayName="HISTORY OF MEDICATION USE" codeSystemName="LOINC"/>
                    <text/>
                    <entry>
                        <observation moodCode="EVN" classCode="OBS">
                            <code code="DE06.00.164.00" codeSystem="2.16.156.10011.2.2.1" displayName="中药类别代码" codeSystemName="卫生信息数据元目录"/>
                            <value code="1" xsi:type="CD" codeSystem="2.16.156.10011.2.3.1.157" displayName="未使用" codeSystemName="中药使用类别代码表"/>
                        </observation>
                    </entry>
                    <entry>
                        <substanceAdministration moodCode="EVN" classCode="SBADM">
                            <text/>
                            <routeCode code="9" codeSystem="2.16.156.10011.2.3.1.158" displayName="其他用药途径" codeSystemName="用药途径代码表"/>
                            <doseQuantity unit="mg" value="0.00"/>
                            <rateQuantity unit="次/天" value="0"/>
                            <administrationUnitCode code="00" codeSystem="2.16.156.10011.2.3.1.211" displayName="原料" codeSystemName="药物剂型代码表"/>
                            <consumable>
                                <manufacturedProduct>
                                    <manufacturedLabeledDrug>
                                        <code/>
                                        <name>无</name>
                                    </manufacturedLabeledDrug>
                                </manufacturedProduct>
                            </consumable>
                            <entryRelationship typeCode="COMP">
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE08.05.020.00" codeSystem="2.16.156.10011.2.2.1" displayName="药物类型" codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="ST">无</value>
                                </observation>
                            </entryRelationship>
                            <entryRelationship typeCode="COMP">
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE06.00.147.00" codeSystem="2.16.156.10011.2.2.1" displayName="用药天数" codeSystemName="卫生信息数据元目录"/>
                                    <value unit="天" value="0" xsi:type="PQ"/>
                                </observation>
                            </entryRelationship>
                            <entryRelationship typeCode="COMP">
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE06.00.135.00" codeSystem="2.16.156.10011.2.2.1" displayName="药物使用总剂量" codeSystemName="卫生信息数据元目录"/>
                                    <value unit="mg" value="0.00" xsi:type="PQ"/>
                                </observation>
                            </entryRelationship>
                            <entryRelationship typeCode="COMP">
                                <observation moodCode="EVN" classCode="OBS">
                                    <code code="DE06.00.134.00" codeSystem="2.16.156.10011.2.2.1" displayName="用药停止日期" codeSystemName="卫生信息数据元目录"/>
                                    <value xsi:type="TS" value="19000101000000"/>
                                </observation>
                            </entryRelationship>
                        </substanceAdministration>
                    </entry>
                </section>
            </component>
            <component>
                <section>
                    <code code="47519-4" displayName="HISTORY OF PROCEDURES" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
                    <text/>
                    <entry>
                        <!--  1..1 手术记录  -->
                        <procedure classCode="PROC" moodCode="EVN">
                            <!--  手术（操作）代码  -->
                            <code code="00.0100" codeSystem="2.16.156.10011.2.3.3.12" codeSystemName="手术(操作)代码表(ICD-9-CM)" displayName="头和颈部血管治疗性超声"/>
                            <statusCode/>
                            <!-- 操作日期/时间 -->
                            <effectiveTime value="20240306000000"/>
                            <entryRelationship typeCode="COMP">
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE06.00.094.00" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录" displayName="手术（操作）名称"/>
                                    <value xsi:type="ST">头和颈部血管治疗性超声</value>
                                </observation>
                            </entryRelationship>
                            <!--  0..1 麻醉信息  -->
                            <entryRelationship typeCode="COMP">
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE06.00.074.00" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录" displayName="麻醉方法名称"/>
                                    <value xsi:type="ST">局部麻醉</value>
                                </observation>
                            </entryRelationship>
                            <entryRelationship typeCode="COMP">
                                <observation classCode="OBS" moodCode="EVN">
                                    <code code="DE06.00.073.00" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录" displayName="麻醉方法代码"/>
                                    <value code="3" codeSystem="2.16.156.10011.2.3.1.159" codeSystemName="麻醉方法代码表" xsi:type="CD" displayName="局部麻醉"/>
                                </observation>
                            </entryRelationship>
                        </procedure>
                    </entry>
                </section>
            </component>
            <component>
                <section>
                    <code code="DE06.00.087.00" codeSystem="2.16.156.10011.2.2.1" displayName="其他医学处置" codeSystemName="卫生信息数据元目录"/>
                    <text>无</text>
                </section>
            </component>
            <component>
                <section>
                    <code code="11348-0" displayName="HISTORY OF PAST ILLNESS" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC"/>
                    <text/>
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE02.10.026.00" displayName="既往疾病史" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"/>
                            <value xsi:type="ST">无</value>
                        </observation>
                    </entry>
                    <entry>
                        <observation classCode="OBS" moodCode="EVN">
                            <code code="DE02.10.033.00" displayName="疾病种类代码" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"/>
                            <value xsi:type="CD" code="99" displayName="其他" codeSystem="2.16.156.10011.2.3.1.12" codeSystemName="既往常见疾病种类代码表"/>
                        </observation>
                    </entry>
                </section>
            </component>
            <component>
                <section>
                    <code code="18776-1" codeSystem="2.16.840.1.113883.6.1" displayName="referal" codeSystemName="LOINC"/>
                    <text/>
                    <entry>
                        <observation moodCode="EVN" classCode="OBS">
                            <code code="DE06.00.177.00" codeSystem="2.16.156.10011.2.2.1" displayName="转诊原因" codeSystemName="卫生信息数据元目录"/>
                            <effectiveTime value="20240306"/>
                            <value xsi:type="ST">专科诊治</value>
                            <performer>
                                <assignedEntity>
                                    <id/>
                                    <assignedPerson>
                                        <name>无</name>
                                    </assignedPerson>
                                    <representedOrganization>
                                        <name>妇产科</name>
                                        <asOrganizationPartOf>
                                            <wholeOrganization>
                                                <id root="2.16.156.10011.1.5" extension="0305008003"/>
                                                <name>深圳市南山区医疗集团总部南油社区健康服务中心</name>
                                            </wholeOrganization>
                                        </asOrganizationPartOf>
                                    </representedOrganization>
                                </assignedEntity>
                            </performer>
                        </observation>
                    </entry>
                </section>
            </component>
            <component>
                <section>
                    <code code="18776-5" codeSystem="2.16.840.1.113883.6.1" displayName="TREATMENT PLAN" codeSystemName="LOINC"/>
                    <text/>
                    <entry>
                        <observation moodCode="EVN" classCode="OBS">
                            <code code="DE01.00.159.00" codeSystem="2.16.156.10011.2.2.1" displayName="治疗方案" codeSystemName="卫生信息数据元目录"/>
                            <value xsi:type="ST">无</value>
                        </observation>
                    </entry>
                </section>
            </component>
            <component>
                <section>
                    <code code="69730-0" codeSystem="2.16.840.1.113883.6.1" displayName="Instructions" codeSystemName="LOINC"/>
                    <text/>
                    <entry>
                        <observation moodCode="DEF" classCode="OBS">
                            <code code="DE06.00.066.00" codeSystem="2.16.156.10011.2.2.1" codeSystemName="卫生信息数据元目录"/>
                            <value xsi:type="ST">无</value>
                        </observation>
                    </entry>
                </section>
            </component>
        </structuredBody>
    </component>
</ClinicalDocument>